﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;
using BUS;

namespace GUI
{
    public partial class FormChiTietPhieuNhap : Window
    {
        public FormChiTietPhieuNhap()
        {
            InitializeComponent();
        }

        private void FormChiTietPhieuNhap_Load(object sender, EventArgs e)
        {
            FormDSPhieuNhap dspn = new FormDSPhieuNhap();
            int ma = dspn.Ma_PN;
            txtMaPN.Text = ma.ToString();
            CTPhieuNhapBUS bus = new CTPhieuNhapBUS();
            List<CTPhieuNhapDTO> ds = bus.LayCTPhieuNhap(dspn.Ma_PN);
            dataGridViewCTPN.Rows.Clear();
            for (int i = 0; i < ds.Count(); i++)
            {
                SanPhamBUS sp = new SanPhamBUS();
                string tensp = sp.LayTenSP(ds[i].MaSP);
                dataGridViewCTPN.Rows.Add(i + 1, ds[i].MaSP,tensp, ds[i].NgayNhap, ds[i].SoLuong);
            }
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Close();
        }

    }
}
